package com.gexiaobao.pigeon.app.model.bean

import android.text.TextUtils

/**
 * @Author      : hxw
 * @Date        : 2024/8/26 14:18
 * @Describe    :
 */
data class UploadImageBean(
    /**
     * Gallery selection mode(画廊选择模式)
     */
    var chooseModel: Int = -1,
    /**
     * The media resource type
     */
    var mimeType: String = "",

    var path: String = "",
    var cutPath: String = "",
    var compressPath: String = "",
    var isCut: Boolean = false,
    var compressed: Boolean = false,
    /**
     * app sandbox path(应用沙箱路径)
     */
    var sandboxPath: String = "",
    /**
     * Whether the original image is displayed(是否显示原始图像)
     */
    var isOriginal: Boolean = false,
    /**
     * # Check the original button to get the return value original path(检查原始按钮以获得返回值原始路径)
     */
    var originalPath: String = "",
    /**
     * watermark path(动态路径水印)
     */
    var watermarkPath: String = "",

    var isChecked: Boolean = false,
    var imagePath: String = ""

) {
    fun getAvailablePath(): String {
        var path = path
        if (isCut) {
            path = cutPath
        }
        if (compressed) {
            path = compressPath
        }
        if (isToSandboxPath()) {
            path = sandboxPath
        }
        if (isOriginal) {
            path = originalPath
        }
        if (isWatermarkPath()) {
            path = watermarkPath
        }
        return path
    }

    private fun isWatermarkPath(): Boolean {
        return !TextUtils.isEmpty(watermarkPath)
    }

//    private fun getWatermarkPath(): String {
//        return watermarkPath
//    }

//    private fun isOriginal(): Boolean {
//        return isOriginal && !TextUtils.isEmpty(originalPath)
//    }

//    private fun getOriginalPath(): String {
//        return originalPath
//    }

//    private fun isCut(): Boolean {
//        return isCut && !TextUtils.isEmpty(cutPath)
//    }

//    private fun getCutPath(): String {
//        return cutPath
//    }

//    fun isCompressed(): Boolean {
//        return compressed && !TextUtils.isEmpty(compressPath)
//    }

//    private fun getCompressPath(): String {
//        return compressPath
//    }

    private fun isToSandboxPath(): Boolean {
        return !TextUtils.isEmpty(sandboxPath)
    }

//    private fun getSandboxPath(): String {
//        return sandboxPath
//    }

}


